package com.foxconn.ipebg.common.system.controller;

import ipebg.mzk.facade.entity.MsAdminUser;
import ipebg.mzk.facade.system.bean.MenuTreeBean;
import ipebg.mzk.facade.system.service.MenuService;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSON;
import com.foxconn.ipebg.common.base.security.SecurityUserHolder;
@Controller
@RequestMapping("/menuTree")
public class MenuController {
   @Resource(name="menuServiceImpl")
   private MenuService menuService;

   @RequestMapping("tree")
   @ResponseBody
   public String init(){
	   MsAdminUser user = SecurityUserHolder.getCurrentUser();
	   List<MenuTreeBean> functionList = menuService.menuList(user);
	   return JSON.toJSONString(functionList);
   }
}
